<?php
namespace BP\Sys;
require_once("BP/Web/WebUser.php");
class SysFileManager extends EntityOID {
	public function getWebPath () 
	{
		return $this->GetValStringByKey(SysFileManagerAttr::$WebPath);
	}
	public function setWebPath ($value) // [String value]
	{
		$this->SetValByKey(SysFileManagerAttr::$WebPath, $value);
	}
	public function getAttrFileNo () 
	{
		return $this->GetValStringByKey(SysFileManagerAttr::$AttrFileNo);
	}
	public function setAttrFileNo ($value) // [String value]
	{
		$this->SetValByKey(SysFileManagerAttr::$AttrFileNo, $value);
	}
	public function getAttrFileName () 
	{
		return $this->GetValStringByKey(SysFileManagerAttr::$AttrFileName);
	}
	public function setAttrFileName ($value) // [String value]
	{
		$this->SetValByKey(SysFileManagerAttr::$AttrFileName, $value);
	}
	public function getMyFileName () 
	{
		return $this->GetValStringByKey(SysFileManagerAttr::$MyFileName);
	}
	public function setMyFileName ($value) // [String value]
	{
		$this->SetValByKey(SysFileManagerAttr::$MyFileName, $value);
	}
	public function getMyFileWebUrl () 
	{
		return $this->getWebPath();
	}
	public function getMyFileExt () 
	{
		return $this->GetValStringByKey(SysFileManagerAttr::$MyFileExt);
	}
	public function setMyFileExt ($value) // [String value]
	{
		$this->SetValByKey(SysFileManagerAttr::$MyFileExt, $value);
	}
	public function getRec () 
	{
		$s = $this->GetValStringByKey(SysFileManagerAttr::$Rec);
		if ((($s . NULL) . $s->equals("")))
		{
			return NULL;
		}
		return $s;
	}
	public function setRec ($value) // [String value]
	{
		$this->SetValByKey(SysFileManagerAttr::$Rec, $value);
	}
	public function getRecText () 
	{
		return $this->GetValRefTextByKey(SysFileManagerAttr::$Rec);
	}
	public function getEnName () 
	{
		return $this->GetValStringByKey(SysFileManagerAttr::$EnName);
	}
	public function setEnName ($value) // [String value]
	{
		$this->SetValByKey(SysFileManagerAttr::$EnName, $value);
	}
	public function getRefVal () 
	{
		return $this->GetValByKey(SysFileManagerAttr::$RefVal);
	}
	public function setRefVal ($value) // [Object value]
	{
		$this->SetValByKey(SysFileManagerAttr::$RefVal, $value);
	}
	public function getMyFilePath () 
	{
		return $this->GetValStringByKey(SysFileManagerAttr::$MyFilePath);
	}
	public function setMyFilePath ($value) // [String value]
	{
		$this->SetValByKey(SysFileManagerAttr::$MyFilePath, $value);
	}
	public function getMyFileH () 
	{
		return $this->GetValIntByKey(SysFileManagerAttr::$MyFileH);
	}
	public function setMyFileH ($value) // [int value]
	{
		$this->SetValByKey(SysFileManagerAttr::$MyFileH, $value);
	}
	public function getMyFileW () 
	{
		return $this->GetValIntByKey(SysFileManagerAttr::$MyFileW);
	}
	public function setMyFileW ($value) // [int value]
	{
		$this->SetValByKey(SysFileManagerAttr::$MyFileW, $value);
	}
	public function getMyFileSize () 
	{
		return $this->GetValIntByKey(SysFileManagerAttr::$MyFileSize);
	}
	public function setMyFileSize ($value) // [float value]
	{
		$this->SetValByKey(SysFileManagerAttr::$MyFileSize, $value);
	}
	public function getRDT () 
	{
		return $this->GetValStringByKey(SysFileManagerAttr::$RDT);
	}
	public function setRDT ($value) // [String value]
	{
		$this->SetValByKey(SysFileManagerAttr::$RDT, $value);
	}
	public function getNote () 
	{
		return $this->GetValStringByKey(SysFileManagerAttr::$Note);
	}
	public function setNote ($value) // [String value]
	{
		$this->SetValByKey(SysFileManagerAttr::$Note, $value);
	}
	public static function constructor__ () 
	{
		$me = new self();
		return $me;
	}
	public static function constructor__I ($_OID) // [int _OID]
	{
		$me = new self();
		return $me;
	}
	public function getEnMap () 
	{
		if (($this->get_enMap() != NULL))
		{
			return $this->get_enMap();
		}
		$map = new Map("Sys_FileManager", "文件管理�?");
		$map->AddTBIntPKOID();
		$map->AddTBString(SysFileManagerAttr::$AttrFileName, NULL, "指定名称",  TRUE ,  FALSE , 0, 50, 20);
		$map->AddTBString(SysFileManagerAttr::$AttrFileNo, NULL, "指定编号",  TRUE ,  FALSE , 0, 50, 20);
		$map->AddTBString(SysFileManagerAttr::$EnName, NULL, "关联的表",  FALSE ,  TRUE , 1, 50, 20);
		$map->AddTBString(SysFileManagerAttr::$RefVal, NULL, "主键�?",  FALSE ,  TRUE , 1, 50, 10);
		$map->AddTBString(SysFileManagerAttr::$WebPath, NULL, "Web路径",  FALSE ,  TRUE , 0, 100, 30);
		$map->AddMyFile("文件名称");
		$map->AddTBString(SysFileManagerAttr::$RDT, NULL, "上传时间",  TRUE ,  TRUE , 1, 50, 20);
		$map->AddTBString(SysFileManagerAttr::$Rec, NULL, "上传�?",  TRUE ,  TRUE , 0, 50, 20);
		$map->AddTBStringDoc();
		$this->set_enMap($map);
		return $this->get_enMap();
	}
	protected function beforeInsert () 
	{
		$this->setRec($WebUser->getNo());
		$this->setRDT($DataType->getCurrentDataTime());
		return parent->beforeInsert();
	}
	protected function beforeDelete () 
	{
		if ($this->getRec()->equals($WebUser->getNo()))
		{
			return parent->beforeDelete();
		}
		return parent->beforeDelete();
	}
	abstract function UpdateLoadFileOfAccess ($MyFilePath); // [String MyFilePath]
}
?>
